<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
    <button>修改对象</button>
</body>
<script>
    let ab = {
        "name": 1,
        "age": 2
    }
    console.log(ab);
    document.querySelector("button").addEventListener('click', () => {
        const {age, ...rest} = ab;
        ab = rest
        console.log(ab);
    })
</script>
</html>